package com.wudl.common;

import java.io.InputStream;
import java.util.Properties;

/**
 * @ClassName : ConfigUtil
 * @Description : 配置工具类
 * @Author :wudl
 * @Date: 2020-11-17 22:01
 */

public class ConfigUtil {

    static Properties props = new Properties();

    static {
        try {
            InputStream inputStream = ConfigUtil.class.getClassLoader().getResourceAsStream("config.properties");
            props.load(inputStream);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 根据key  获取值
     *
     * @param key
     * @return
     */
    public static String getConfig(String key) {
        return (String) props.get(key);
    }
}
